﻿<%@ Control Language="C#" Inherits="Web.Control.WWW.files.File" %>
<% if (DocModel == null)
   {%>

<script type="text/javascript">
var gDocID = "";
var gDateFormat = "";
var gStrDate = "";
var gIsLike = false;
</script>

<%}%>
<%else
	{ %>
<div class="common">
	<div id="new_body">
		<div id="body_900">
			<div id="body_left"></div>
			<div id="body_main">
				<div class="Center9001">
					<div class="Center9001right">
						<div class="Title">
							<h1><img alt="" src="/images/<%= DocModel.FileFormat.Trim().Replace('/','_') %>.gif" class="img" /> <%=HttpUtility.HtmlEncode(DocModel.Title) %></h1>
						</div>
						<div class="center9001content">
							<div class="content628">
								<div class="floatl">
								<%=(BLF.StaticData.HaveLanguageImage(DocModel.LanguageLearn) ?  "<a href='" + LoginHost + "/files/learn-" +DocModel.LanguageLearn + "-all/1-1.htm'><img src=\"/images/language_"+DocModel.LanguageLearn+".gif\" border='0' title='" + GetText("C0105", new string[] { BLF.StaticData.GetLanguageText(DocModel.LanguageLearn.ToString()) }) + "' align='absmiddle' /></a>" : "")%> <a href='<%=LoginHost %>/files/learn-<%=DocModel.LanguageLearn%>-all/1-1.htm'><%=GetText("C0105", new string[] { BLF.StaticData.GetLanguageText(DocModel.LanguageLearn) })%></a>&nbsp;&nbsp;<%=(BLF.StaticData.HaveLanguageImage(DocModel.BaseLanguage) ? "<a href='" + LoginHost + "/files/learn-all-" + DocModel.BaseLanguage + "/1-1.htm'><img src=\"/images/language_" + DocModel.BaseLanguage + ".gif\" border='0' title='" + GetText("C0105", new string[] { BLF.StaticData.GetLanguageText(DocModel.BaseLanguage.ToString()) }) + "' align='absmiddle' /></a>" : "")%> <a href='<%=LoginHost %>/files/learn-all-<%=DocModel.BaseLanguage%>/1-1.htm'><%=GetText("C2019", new string[] { BLF.StaticData.GetLanguageText(DocModel.BaseLanguage) })%></a>
								</div>
								<div class="floatr">
									<%if (Page.User.Identity.Name == DocModel.MemberNo) {%>
									<a href="/files/UpdateFile.htm?docid=<%=DocModel.DocID %>" title="<%=GetText("C0053")%>"><img src="/Images/icon_common_edit.gif" align="absmiddle" border="0" /></a> <a href="/files/UpdateFile.htm?docid=<%=DocModel.DocID %>"><%=GetText("C0053")%></a>&nbsp;&nbsp;<a href="#" title="<%=GetText("C0050")%>"><img src="/Images/gaction_delete.gif" align="absmiddle" onclick="DeleteFiles()" /></a> <a href="#" onclick="DeleteFiles()"><%=GetText("C0050")%></a>&nbsp;&nbsp;
									<%} %>
									<%if (DocModel.ScribdDocID > 0 && DocModel.ScribdKey.Length > 0 && DocModel.ScribdState > 0)
           {%><a href="http://www.scribd.com/full/<%=DocModel.ScribdDocID%>?access_key=<%=DocModel.ScribdKey%>" target="_blank" title="<%=GetText("SF017")%>"><img alt="" src="/images/icon_file_full.gif" align="absmiddle" border="0" /></a> <a href="http://www.scribd.com/full/<%=DocModel.ScribdDocID%>?access_key=<%=DocModel.ScribdKey%>" target="_blank"><%=GetText("SF017")%></a><%} %></div>
								<div class="clear"></div>
							</div>
							<%if (DocModel.ScribdDocID > 0 && DocModel.ScribdKey.Length > 0 && DocModel.ScribdState > 0) {%>
							<div class="margin10" style="border-bottom:3px #bdbdbd solid">
								<div id='embedded_flash'></div>
								<script type="text/javascript" >
								  var scribd_doc = scribd.Document.getDoc(<%= DocModel.ScribdDocID %>,'<%= DocModel.ScribdKey %>'); 
								  scribd_doc.addParam('height');
								  scribd_doc.addParam('width');
								  scribd_doc.addParam('public',true);
								  scribd_doc.write('embedded_flash');  
								</script>
							</div>
							<%} %>
                            <% if(DocModel.Desc.Length > 0) { %>
							<div>
								<div>
									<div class="floatl" style="width:80%"><h3 class="spectitle"><%=GetText("RS050")%></h3></div>
									<div class="floatr"><a class="specbtn" href="#" onclick="Download()" title="<%=GetText("SF201")%>"><span>&nbsp;&nbsp;&nbsp;<%=GetText("SF201")%>&nbsp;&nbsp;&nbsp;</span></a></div>
									<div class="clear"></div>
								</div>
								<div class="content628D"><%=HttpUtility.HtmlEncode(DocModel.Desc) %></div>
							</div>
                            <% } %>
							<div class="margin20">
								<h3 class="spectitle"><%=GetText("C0018")%></h3>
								<div class="content628D"><%=FileLevel %></div>
							</div>
                            <% if(TagList.Count > 0) {%>
							<div class="Content628">
								<div class="pink18"><%=GetText("SF018", new string[] { HttpUtility.HtmlEncode(DocModel.Title) })%></div>
								<!--content area-->
								<div class="files_content_tag">
									<% for (int i = 0; i < TagList.Count; i++)
									{ %>
									<a href="<%#LoginHost%>/files/tag/<%= TagList[i] %>-1.htm"><%=HttpUtility.HtmlEncode(TagList[i])%></a>&nbsp;&nbsp;
									<% } %>
								</div>
								<!--content end-->
							</div>
                            <% } %> 
							<div class="ad_site">
							<script type="text/javascript"><!--
							google_ad_client = "pub-2873751441352197";
							google_ad_width = 468;
							google_ad_height = 60;
							google_ad_format = "468x60_as";
							google_ad_type = "text";
							google_ad_channel = "";
							google_color_border = "ffffff";
							google_color_bg = "ffffff";
							google_color_link = "336699";
							google_color_text = "333333";
							google_color_url = "333333";
							//-->
							</script>
							<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
							</div>
							<div id="CommentList" class="content628 margin20T" <%=CModel.Count>0?"":"style='display: none'" %>>
								<h3 style="border-bottom: 1px #eee solid; padding-bottom: 5px"><%=GetText("C0111")%></h3>
								<div id="divComment" class="magin20">
										<% for (int i = 0; i < CModel.Count; i++)
									   { %>
									<div class="files_comment">
										<div class="files_comment_avatar">
											<div class="pic50">
												<a class="photo_50" href="<%#LoginHost%>/<%= CModel[i].MemberNo %>.htm"><%= CModel[i].Avatar == "" ? "<img src=\"/Images/No_pic.gif\" />" : string.Format("<img src=\"{0}\" />", CModel[i].Avatar)%></a>
											</div>
										</div>
										<div class="files_comment_Bacontent">
											<div class="files_comment_acontent">
												<a href='<%#LoginHost%>/<%= CModel[i].MemberNo %>.htm'><%= CModel[i].Nickname %></a> <span class="grey10"><%=FormatDiffDate(GetText("C0036"), CModel[i].DiffLastUpdate)%></span>
												<div class="margin5"><%=Lx.Web.Common.UI.Globals.HtmlStrippedText(CModel[i].Desc).Replace("\n", "<br/>")%></div>
											</div>
										</div>
										<div class="clear"></div>
									</div>
									<%} %>
								</div>
								<!-- 更多的评论 -->
								<div class="margin5" style="text-align: right"><a href="<%#LoginHost%>/files/comment-1-<%=DocModel.DocID %>.htm"><%=GetText("WK037", new string[] { HttpUtility.HtmlEncode(DocModel.Title) })%></a></div>
							</div>                             
								<div class="margin10">
									<a name="comment"></a><span class="black16b"><%=GetText("SF019", new string[] { HttpUtility.HtmlEncode(DocModel.Title) })%></span>
									<p>
									<textarea id="texta_desc" rows="5" class="common100D"></textarea><span name="__V_S" vt="0" elt1="texta_desc" reg="[\s\S]{1,3000}" style="color: Red; display: none" class="validMsg red10"><br /><%=GetText("ST155",new string[]{"1","3000"})%></span>
									</p>
									<p><input type="button" id="btnSave" value="<%=GetText("C0045")%>" <%=(((Lx.Web.Common.UI.TDTPageBase)Page).IsAffirm)?"onclick=\"AddComment()\"":"onclick=\"NotAffirm()\""%> class="button" /></p>
									<div id="div_error" style="color: Red;">
									</div>
									<!-- Ajax Loading DIV -->
									<div id="div_loading" style="display: none;"><%=GetText("C0074")%>...</div>
								</div>
							</div>
						</div>
					</div>
					<div class="Center9001left">
						<div class="right_layerA margin20T">
							<input id="txtSear" name="txtSear_name" type="text" class="common160" onkeydown="$Enter$(event,'bttSear')"/><a href="#" id="bttSear" name="bttSear_name" class="buttonimg"  onclick="javascript:location.href='/files/search-'+document.getElementById('txtSear').value.replace(/\?/gi, '').replace(/\//gi, '').replace(/-/gi, '').replace(/&/gi, '')+'.htm';"  title="<%=GetText("C0066")%>" ><img src="/Images/btn_search.gif" border="0" class="img" /></a><br /><a href="<%=LoginHost%>/files/AdvancedSearch.htm" ><%=GetText("C0067")%></a>
						</div>
						<div class="right_layerA margin20T">
						<%if (FModel.Count > 0)
        { %>
							<div class="layer_contentA">
								<h4><%=GetText("SF020")%></h4>
								<div class="margin5">
									<% for (int i = 0; i < TagList.Count; i++)
            { %>
									<a href="/files/tag/<%= TagList[i] %>-1.htm"><%=HttpUtility.HtmlEncode(TagList[i])%></a>&nbsp;&nbsp;
									<% } %>
								</div>
								<div class="margin10 fi_related_window">
									<div>
										<ul class="fi_related_rightline">
								<% for (int i = 0; i < FModel.Count; i++)
           { %>
										   <li><a href="<%#LoginHost%>/files/doc/<%=FModel[i].DocID %>.htm" title="<%=HttpUtility.HtmlAttributeEncode(FModel[i].Title) %>"><img src="/images/<%= FModel[i].FileFormat.Trim().Replace('/','_') %>_16.gif" align="absmiddle" /></a> <a href="<%#LoginHost%>/files/doc/<%=FModel[i].DocID %>.htm"><%=HttpUtility.HtmlEncode(FModel[i].Title)%></a> <span class="grey12" dir="ltr">(<%= FModel[i].Views%>)</span></li>
								<%} %>
										</ul>
									</div>
								</div>								
							</div>
						</div>
						<%} %>
						<div class="right_layerA">
							<div class="layer_contentA">
								<h4><%=GetText("SF022")%></h4>
								<div class="layer_contentA5">
									<div class="margin10">
										<p><a href="#" onclick="Download()" title="<%=GetText("SF201")%>"><img src="/images/icon_common_down.gif" border="0" align="absmiddle" /></a> <strong><a href="#" onclick="Download()" title="<%=GetText("SF201")%>"><%=GetText("SF201")%></a></strong>&nbsp;&nbsp;<%= DocModel.DownLoads %> <%=GetText("SF038")%></p>
										<div>
											<div id="ThaiRating" onmouseout="RateOut()" class="floatl">
												<%for (int i = 0; i < Math.Round(DocModel.Rates, 0); i++)
												  {%>
												<span id="ThaiRating_Star_<%=(i+1)%>" onmouseover="RateOver(<%=(i+1)%>)" onclick="RateClick(<%=(i+1)%>)" class="ratingStar filledRatingStar" style="float: left;">&nbsp;</span>
												<%} %>
												<%for (int i = (int)Math.Round(DocModel.Rates, 0); i < 5; i++)
												  { %>
												<span id="ThaiRating_Star_<%=(i+1)%>" onmouseover="RateOver(<%=(i+1)%>)" onclick="RateClick(<%=(i+1)%>)" class="ratingStar emptyRatingStar" style="float: left;">&nbsp;</span>
												<%} %>
											</div>
											<div class="floatl">&nbsp;&nbsp;<strong><span id="RFen"><%=DocModel.Rates.ToString("N1")%></span> <%=GetText("WK098")%></strong> <span dir="ltr">(</span><span id="RRen" dir="ltr"><%=DocModel.Votes%></span> <%=GetText("WK096")%><span dir="ltr">)</span></div>
											<div class="clear"></div>
										</div>
									</div>
									<div class="margin5">
										<a href="javascript:void(0);" onclick="AddDelLike()"><img id="imgLike" alt="" src="/images/<%=(IsLike?"icon_good2":"icon_good")%>.gif" border="0" align="absmiddle" /></a> <a href="javascript:void(0);" onclick="AddDelLike()"><%=GetText("SF202")%></a> <span id="LikeID"><%=DocModel.Likes %></span> <%=GetText("SF037")%></div>
									<div class="margin5">
										<a href="#" title="<%=GetText("SR016")%>" <%=(((Lx.Web.Common.UI.TDTPageBase)Page).IsAffirm)?"onclick=\"$ShareRes$()\"":"onclick=\"NotAffirm()\""%> title="<%=GetText("C3008")%>"><img src="/Images/icon_common_share.gif" align="absmiddle" border="0" /></a> <a href="#" title="<%=GetText("SR016")%>" <%=(((Lx.Web.Common.UI.TDTPageBase)Page).IsAffirm)?"onclick=\"$ShareRes$()\"":"onclick=\"NotAffirm()\""%>><%=GetText("C3008")%></a></div>
									<div class="margin5">
										<a href="/files/comment-1-<%=DocModel.DocID%>.htm" title="<%=GetText("C0111")%>"><img src="/Images/icon_common_comment.gif" align="absmiddle" border="0" /></a> <a href="/files/comment-1-<%=DocModel.DocID%>.htm"><%=GetText("C0111")%> <span id="commentCount" dir="ltr">(<%=DocModel.CommentCount%>)</span></a></div>
									<div class="margin5">
										<a href="#" title="<%=GetText("C0110")%>" onClick="$Feedback$()" title="<%=GetText("C0110")%>"><img src="/Images/icon_common_flag.gif" align="absmiddle" border="0" /></a> <a href="#" title="<%=GetText("C0110")%>" onClick="$Feedback$()"><%=GetText("C0110")%></a></div>
									<div class="margin5">
										<script type="text/javascript">
										addthis_url	= window.location.href;  
										addthis_title  = "<%=HttpUtility.HtmlEncode(DocModel.Title)%>"; 
										addthis_pub	= "italki.com";
										//document.getElementById("shareUrl").value = addthis_url;
										</script>
										<script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12"></script>
									</div>
								</div>
							</div>
						</div>
						<div class="right_layerA">
							<div class="layer_contentA">
								<h4><%=GetText("SF043")%></h4>
								<div class="layer_contentA5">
									<div class="floatl pic50 wid65"><a class="photo_50" href="<%#LoginHost%>/<%=DocModel.MemberNo%>.htm">
									<%=DocModel.Avatar.ToString() == "" ? "<img src=\"/Images/No_pic.gif\" />" : "<img src='"+DocModel.Avatar+"' />"%></a></div>
									<div class="floatr wid120">
										<span class="blue14bu"><a href="<%#LoginHost%>/<%=DocModel.MemberNo%>.htm"><%=HttpUtility.HtmlEncode(DocModel.Nickname)%></a></span><br /><%=DocModel.CreateDate.ToString("HH:mm, dd/MM/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)%></div>
									<div class="clear"></div>
								</div>
							</div>
						</div>
					</div>
					<div class="clear"></div>
				</div>
			</div>
			<div id="body_right"></div>
			<div class="clear"></div>
		</div>
		<div id="body_900F"></div>
	</div>
<div id="CommentItem" class="magin20" style="display:none">
	<div class="files_comment">
		<div class="files_comment_avatar">
			<div class="pic50"><a class="photo_50" href="<%#LoginHost%>/$MemberNo$.htm">$Avatar$</a></div>
		</div>
		<div class="files_comment_Bacontent">
			<div class="files_comment_acontent">
				<a href='<%#LoginHost%>/$MemberNo$.htm'>$Nickname$</a> <span class="grey10">$sayTime$</span><div class="margin5">$Desc$</div>
			</div>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
</div>
<script type="text/javascript">
var gDocID = "<%= DocModel.DocID %>";
var gDateFormat = "<%=GetText("C0033")%>";
var gStrDate = "<%=GetText("C0036")%>";
var gIsLike = <%=(IsLike?"false":"true")%>;
var gRequest = false;
var sRequest = "<%=GetText("WK051")%>";
var sRateValue =<%=(int)Math.Round(DocModel.Rates, 0) %>;
var RateValue = sRateValue;
var tmp = sRateValue;
var delTitle = "<%=GetText("C0050")%>";
var isDelSure = "<%=GetText("SF107")%>";
var C0069 = '<%=GetText("C0069")%>';
var gCancel = "<%=GetText("C0056")%>";
</script>
<% } %>